package com.fzrskj.cloud.free.core.enums.transfer;

/**
 * BizTransferStatusEnum.
 *
 * @author zj.
 *         Created on 2019/5/6 0006.
 */
public enum BizTransferStatusEnum {
    /**
     * 交易中.
     */
    DEALING(0, "交易中"),
    /**
     * 已完成.
     */
    SUCCESS(1, "已完成"),
    /**
     * 已取消.
     */
    CANCEL(2, "已取消"),
    /**
     * 已过期.
     */
    EXPIRED(3, "已过期");

    private Integer status;

    private String name;

    BizTransferStatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public String getName() {
        return name;
    }

    public static String getName(Integer status) {
        for (BizTransferStatusEnum statusEnum : BizTransferStatusEnum.values()) {
            if (statusEnum.getStatus().equals(status)) {
                return statusEnum.getName();
            }
        }
        return null;
    }
}
